package com.qf.springmvcdemo;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

//@RestController
@Controller
public class HelloController {


    @GetMapping("/hello")
    public String hello() {
        System.out.println("HelloController.hello");
        return "hello:" + System.currentTimeMillis();
    }

    @GetMapping("/demo123")
    public void demo() {
    }

    @GetMapping("/demo2")
    public String demo2(ModelMap modelMap) {
        System.out.println("HelloController.demo2");
        modelMap.put("age", 22);
        return "demo02"; // th:text = "${age}"

    }
}
